<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<header class="header1 padding-lr1">
	<!--城市切换-->
	<div class="header1-left">
		<a href="javascript:void(0)" id="city_list_btn">
			<b id="city_txt">${location}</b><span class="ico bgico-2" style="background-image: url(images/img03.png);"></span>
		</a>
	</div>
	<!--/城市切换-->

	<!--寻宝卡、刮刮卡-->
	<!-- <div class="header1-center padding-lr1">
		<div class="tabsyi border-radius5">
      <a class="on" href="javascript:void(0)">寻宝卡</a>
      <a href="javascript:void(0)">刮刮卡</a>
	</div> -->
	<!--/寻宝卡、刮刮卡-->

	<!--搜索-->
    <div class="header1-sous padding-lr1">
		<form  class="background10 border-radius5 overflow-hidden" action="<%=basePath%>shop" method="post">
	      	<input name="" type="submit" value="" class="ico bgico-10" style="background-image: url(images/img04.png);">
	      	<p><input class="sjsou" name="keyword" value="${keyword}" type="text" style="height:37px;" placeholder="输入商家名称/商圈"><p>
      	</form>
    </div>
    <!--/搜索-->

	<!--右则-->
	<div class="header1-right">
		<!-- <a href="###"><span class="ico bgico-3" style="background-image: url(images/img04.png);"></span></a>  -->
		<a href="<%=basePath%>member/index"><span class="ico bgico-3" style="background-image: url(images/img05.png);"></span></a>
	</div>
	<!--/右则-->
</header>
<script type="text/javascript">
	var city_win;
	var ctx = "${pageContext.request.contextPath}";
	$(function() {
		/* var loading = layer.load(0, {
			shade : [ 0.4, '#fff' ]
		}); */
		/* $("#city_txt").html("北京市");
		var geoc = new BMap.Geocoder();
		var geolocation = new BMap.Geolocation();
		geolocation.getCurrentPosition(function(r) {
			if (this.getStatus() == BMAP_STATUS_SUCCESS) {
				var mk = new BMap.Marker(r.point);
				geoc.getLocation(r.point, function(rs) {
					var addComp = rs.addressComponents;
					var current_city = addComp.city;
					$("#city_txt").html(current_city);
					// layer.close(loading);
				});
			} else {
				alert('failed' + this.getStatus());
			}
		}, {
			enableHighAccuracy : true
		}); */
		$("#city_list_btn").on("click", function() {
			city_win = layer.open({
				type : 2,
				closeBtn : 0, //不显示关闭按钮
				area : [ '100%', '90%' ],
				offset : 'b',
				anim : 2,
				shadeClose : true, //开启遮罩关闭
				title : false,
				content : ctx + "/city/listPinyin"
			});
		});
	});
	function setCity(name, code) {
		$("#city_txt").html(name);
		window.location.href = ctx + "/" + root + "?city="+name;
		closeCity();
	}
	function closeCity() {
		layer.close(city_win);
	}
</script>